<?php $__env->startSection('title'); ?><?php echo e( $data->title ); ?> - <?php $__env->stopSection(); ?>

<?php $__env->startSection('description_custom'); ?><?php if( $data->description != '' ): ?><?php echo Helper::removeLineBreak( e( $data->description ) ).' - '; ?><?php endif; ?> <?php $__env->stopSection(); ?>

<?php $__env->startSection('css_style'); ?>
<?php echo HTML::style('public/css/bootstrap-tokenfield.css'); ?>

<?php echo HTML::style('public/css/jquery-ui-1.8.2.custom.css'); ?>


<meta  property="og:image" content="<?php echo URL::asset('public/shots_img'); ?>/<?php echo $data->image; ?>" ></meta>

<?php if( $data->description != '' ): ?>
<meta property="og:description" content="<?php echo Helper::removeLineBreak( e( $data->description ) ); ?>"/>
<?php endif; ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?> 
     
     <?php 
     
     // ** Admin Settings ** //
     $settings = AdminSettings::first();
	 
	 // ** Data User logged ** //
     $user = Auth::user();
	 
	 if( Auth::check() ) {
	 	
		//<---- Verify Membership Status Of User Post Shot if belongs to a team ----->
		$dateNow   = date('Y-m-d G:i:s');
		
   		$likeUser = Like::where( 'shots_id', $data->id )->where('user_id',Auth::user()->id)->where('status',1)->first(); 
     
     $followActive = Followers::where( 'follower', Auth::user()->id )
			 ->where( 'following', $data->user()->id )->where('status',1)->first(); 
			 
       if( $followActive ) {
       	  $textFollow   = Lang::get('users.following');
		  $icoFollow    = '-ok';
		  $activeFollow = 'btnFollowActive';
       } else {
       		$textFollow   = Lang::get('users.follow');
		    $icoFollow    = '-plus';
			$activeFollow = '';
       }
       
	   // Check if report shot
	 $report = ShotsReported::where('user_id', '=', Auth::user()->id)->where('shots_id', '=', $data->id)->first();
		
		$unblock = DB::table('block_user')
	   ->where('user_id',Auth::user()->id)
	   ->where('user_blocked',$data->user()->id)
	   ->orWhere('user_id',$data->user()->id)
	   ->where('user_blocked',Auth::user()->id)
	   ->first();
	   
	   if( Auth::user()->team_id != 0 ){
	 	$teamName = User::find(Auth::user()->team_id);
	 }
	   
	   // TEAMS Membership Check
	   if( Auth::user()->type_account == 3 ) {
		   	
		$teamMembershipStatus = DB::table('paypal_payments_teams')
		->where('user_id', Auth::user()->id)
		->where('expire','>',$dateNow)
		->where('payment_status', '=', 'Completed')
		->orderBy('id', 'desc')
		->first(); 
	   }// Auth Check 3
	   
	   $membershipTeam = DB::table('paypal_payments_teams')
		->where('user_id',Auth::user()->team_id)
		->where('expire','>',$dateNow)
		->where('payment_status', '=', 'Completed')
		->orderBy('id', 'desc')
		->first(); 
	 
	   
	   
	 }//<------- End IF Auth Check
	 
	 $page = Input::get('page');
	 //Active Like
	 $activeLike = '';
	 
	 if( $data->team_id != 0 ){
	 	
	 	$teamData = User::find($data->team_id);
		
	}//<-- IF $data->team_id
		
 ?>
     
<div class="col-md-8">
  
  	   	 <!--********* panel panel-default ***************-->
     	<div class="panel panel-default">
		  <div class="panel-heading grid-panel-title">
		  	
		  	<h1 class="title-shot"><?php echo e( $data->title ); ?>

		  		
		  		<?php if( Auth::check() && Auth::user()->role == 'admin' && Auth::user()->id != $data->user()->id  ): ?>
		  			<a href="javascript:void(0);" data-id="<?php echo $data->id; ?>" class="btn btn-xs btn-danger delete-shot">
   						<i class="glyphicon glyphicon-remove"></i> <?php echo Lang::get('misc.delete'); ?>

   					</a>
		  		<?php endif; ?>
		  		</h1>
		  	<span class="btn-block subtitle-shot col-thumb">
		  		<?php echo Lang::get('misc.by'); ?> <a href="<?php echo URL::to('/'); ?>/<?php echo '@'.$data->user()->username; ?>"><?php echo e( $data->user()->name ); ?></a>
		  		
		  <?php if( $data->team_id != 0 ): ?>
		  		<?php echo Lang::get('misc.for'); ?> <a href="<?php echo URL::to('/'); ?>/<?php echo '@'.$teamData->username; ?>"><?php echo e( $teamData->name ); ?></a>
		  <?php endif; ?>
		  	</span><!-- **btn-block ** -->
		  
		  </div><!-- ** panel-heading ** -->
		  

<div class="position-relative">

		  <div class="btn-block shot-view">
		  	<img src="<?php echo URL::asset('public/shots_img/large'); ?>/<?php echo $data->large_image; ?>" class="imgColor img-responsive" />
		  </div>
            
    </div><!-- div alone -->
          
		  <div class="panel-body">
		  	<?php if( $data->description != '' ): ?>  
			  <h4>
			  	<strong><?php echo Lang::get('misc.description'); ?></strong>
			  </h4>
			  <p class="desc-shot mentions-links"><?php echo Helper::checkText( $data->description ); ?></p>
			  <?php endif; ?>
			  
			  <?php if( $data->attachment != '' ): ?>  
			  
			  <?php
			  // Switch	psd,ai,ps,zip,eps,cdr
			switch($data->extension_file) {
				case "gif":
				case "pjpeg":
				case "jpeg":
				case "jpg":
				case "JPG":
				case "png":
				case "x-png":
					$file_attachment = "<a target='_blank' class='image-thumb preview-attach' href='".URL::to('public/attachment_shots')."/".$data->attachment."' style='background: url(".URL::asset('public/attachment_shots')."/".$data->attachment.") center center; background-size: cover;'></a>"; 
					break;
			    case "psd":
					$file_attachment = '<a target="_blank" href="'.URL::to('public/attachment_shots').'/'.$data->attachment.'" class="btn-default btn-xs btn-border btn-block pull-left text-left display-none fileContainer" style="display: block; margin-bottom: 25px;"> <i class="ico-files ico-file-psd myicon-right"></i> <small class="myicon-right file-name-file">'.$data->attachment.'</small> </a>';
					break;
				case "zip":
					$file_attachment = '<a target="_blank" href="'.URL::to('public/attachment_shots').'/'.$data->attachment.'" class="btn-default btn-xs btn-border btn-block pull-left text-left display-none fileContainer" style="display: block; margin-bottom: 25px;"> <i class="ico-files ico-file-zip myicon-right"></i> <small class="myicon-right file-name-file">'.$data->attachment.'</small> </a>';
					break;
				case "ai":
					$file_attachment = '<a target="_blank" href="'.URL::to('public/attachment_shots').'/'.$data->attachment.'" class="btn-default btn-xs btn-border btn-block pull-left text-left display-none fileContainer" style="display: block; margin-bottom: 25px;"> <i class="ico-files ico-file-ai myicon-right"></i> <small class="myicon-right file-name-file">'.$data->attachment.'</small> </a>';
					break;
				case "eps":
					$file_attachment = '<a target="_blank" href="'.URL::to('public/attachment_shots').'/'.$data->attachment.'" class="btn-default btn-xs btn-border btn-block pull-left text-left display-none fileContainer" style="display: block; margin-bottom: 25px;"> <i class="ico-files ico-file-eps myicon-right"></i> <small class="myicon-right file-name-file">'.$data->attachment.'</small> </a>';
					break;
				case "cdr":
					$file_attachment = '<a target="_blank" href="'.URL::to('public/attachment_shots').'/'.$data->attachment.'" class="btn-default btn-xs btn-border btn-block pull-left text-left display-none fileContainer" style="display: block; margin-bottom: 25px;"> <i class="ico-files ico-file-cdr myicon-right"></i> <small class="myicon-right file-name-file">'.$data->attachment.'</small> </a>';
					break;
				case "pdf":
					$file_attachment = '<a target="_blank" href="'.URL::to('public/attachment_shots').'/'.$data->attachment.'" class="btn-default btn-xs btn-border btn-block pull-left text-left display-none fileContainer" style="display: block; margin-bottom: 25px;"> <i class="ico-files ico-file-pdf myicon-right"></i> <small class="myicon-right file-name-file">'.$data->attachment.'</small> </a>';
					break;
				case "doc":
				case "docx":
					$file_attachment = '<a target="_blank" href="'.URL::to('public/attachment_shots').'/'.$data->attachment.'" class="btn-default btn-xs btn-border btn-block pull-left text-left display-none fileContainer" style="display: block; margin-bottom: 25px;"> <i class="ico-files ico-file-doc myicon-right"></i> <small class="myicon-right file-name-file">'.$data->attachment.'</small> </a>';
					break;
					default:
						 $file_attachment = '<a target="_blank" href="'.URL::to('public/attachment_shots').'/'.$data->attachment.'" class="btn-default btn-xs btn-border btn-block pull-left text-left display-none fileContainer" style="display: block; margin-bottom: 25px;"> <small class="myicon-right file-name-file">'.$data->attachment.'</small> </a>';
					
		  	}
			   ?>
			  	<h4>
			  	<strong><i class="icon-attachment myicon-right"></i> <?php echo Lang::get('misc.attachment'); ?></strong>
			  </h4>
			  
			  <?php echo $file_attachment; ?>

			  
			  
			  <?php endif; ?>
			  
			  <h4>
			  	<strong><?php echo Lang::get('misc.share'); ?></strong>
			  </h4>
		
		<?php $shot_url = URL::to('/') . '/' . Request::path(); ?>
			  
		<ul class="list-inline list-options details-shot padding-zero">
			<li><a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $shot_url; ?>" target="_blank"><img src="<?php echo URL::asset('public/img/social'); ?>/facebook.png" /></a></li>
			<li><a href="https://twitter.com/intent/tweet?url=<?php echo $shot_url; ?>&text=<?php echo e( $data->title ); ?>" data-url="<?php echo $shot_url; ?>" target="_blank"><img src="<?php echo URL::asset('public/img/social'); ?>/twitter.png" /></a></li>
			<li><a href="https://plus.google.com/share?url=<?php echo $shot_url; ?>" target="_blank"><img src="<?php echo URL::asset('public/img/social'); ?>/googleplus.png" /></a></li>
			<li><a href="//www.pinterest.com/pin/create/button/?url=<?php echo $shot_url; ?>&media=<?php echo URL::to('/') . '/public/shots_img/' . $data->image; ?>&description=<?php echo e( $data->title ); ?>" target="_blank"><img src="<?php echo URL::asset('public/img/social'); ?>/pinterest.png" /></a></li>
     </ul> 
			  
		</div><!-- Panel Body -->
   </div><!-- Panel Default -->
  
 <?php if( Auth::check() && Auth::user()->id != $data->user()->id && !$report ): ?>  
   <div class="btn-block">
   	<a href="javascript:void(0);" data-id="<?php echo $data->id; ?>" class="report-shot pull-right text-decoration-none">
   		<small><i class="icon-flag myicon-right"></i> <?php echo Lang::get('misc.report_shot'); ?></small>
   		</a>
   </div>
   <?php endif; ?>
   
   
<?php if( Auth::check() && Auth::user()->id == $data->user()->id ): ?>  
 
 <?php if( Auth::user()->type_account == 3 && isset( $teamMembershipStatus ) 
 	|| Auth::user()->team_id != 0 && isset( $membershipTeam ) && Auth::user()->type_account == 1
 	|| Auth::user()->type_account == 2 ): ?>  
   <!-- ***** Modal ****** -->
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	  <div class="modal-dialog">
	    <div class="modal-content">
	      <div class="modal-header">
	        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
	        <h4 class="modal-title text-left" id="myModalLabel"><?php echo Lang::get('users.edit'); ?> | <strong><?php echo e( $data->title ); ?></strong></h4>
	      </div>
	      
	      <div class="modal-body">
	      	
	     <form class="form-horizontal edit-shot" id="form-edit-shot" method="post" role="form" action="<?php echo URL::to('/'); ?>/shot/edit" enctype="multipart/form-data">
			 
			 <input type="hidden" name="id_shot" value="<?php echo $data->id; ?>" /> 
			 
			 <div class="form-group <?php if( $errors->first('title') ): ?> has-error <?php endif; ?>">
			    <label for="inputEmail3" class="col-sm-2 control-label input-sm"><?php echo Lang::get('misc.title'); ?></label>
			    <div class="col-sm-10">
			      <input type="text" value="<?php echo e( $data->title ); ?>" name="title" class="form-control input-sm" id="title" placeholder="<?php echo Lang::get('misc.title'); ?>">
	     		
	     		<?php if( $errors->first("title") ): ?>    	
			<div class="alert alert-danger btn-sm errors-account" role="alert">
	            	<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	            		<strong><?php echo $errors->first("title"); ?></strong>
	     	</div><!-- Error -->
	     	<?php endif; ?>
	     	
			    </div>
			  </div><!-- **** form-group **** -->

			  
			 <div class="form-group margin-bottom-zero <?php if( $errors->first('tags') ): ?> has-error <?php endif; ?>">
			    <label for="inputEmail3" class="col-sm-2 control-label input-sm"><?php echo Lang::get('misc.tags'); ?></label>
			    <div class="col-sm-10">
			      <input type="text" value="<?php echo $data->tags; ?>" name="tags" class="form-control input-sm" id="tags" placeholder="<?php echo Lang::get('misc.placeholder_tags'); ?>">
			   		<small class="help-block"><?php echo Lang::get('misc.maximum_tags'); ?> </small>
			   
			   <?php if( $errors->first("tags") ): ?>    	
			<div class="alert alert-danger btn-sm errors-account" style="margin-bottom: 15px;" role="alert">
	            	<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	            		<strong><?php echo $errors->first("tags"); ?></strong>
	     	</div><!-- Error -->
	     	<?php endif; ?>
			   </div>
			  </div><!-- **** form-group **** -->
			  
			  <?php if( Auth::user()->team_id != 0 ): ?> 
			  
			  <?php 
			  
			  if( $data->team_id != 0 ) {
			  	$checkInTeam = 'checked="checked"';
			  } else {
				$checkInTeam = '';
			  }
			  ?>
			   <!-- **** form-group **** -->
			  <div class="form-group">
			    <label for="inputEmail3" class="col-sm-2 control-label input-sm"><?php echo Lang::get('misc.for_team'); ?></label>
			    <div class="col-sm-10">
					<label class="checkbox-inline">
					 <input class="no-show" id="forTeam" type="checkbox" <?php echo $checkInTeam; ?> value="1" name="for_team" />
					   <span class="input-sm"><?php echo e($teamName->name); ?> </span>
					</label>
			    </div>
			  </div><!-- **** form-group **** -->
			  <?php endif; ?>
			  
			  <?php 
			  
			  if( $data->url_purchased != '' ) {
			  	$valueForSale = 1;
			  	$checkIn = 'checked="checked"';
			  	$styleInput = '';
			  } else {
			  	$valueForSale = 0;
			  	$styleInput = 'style="display: none;"';
				$checkIn = '';
			  }
			  ?>
			  
			  <!-- **** form-group **** -->
			  <div class="form-group <?php if(Auth::user()->type_account == 1 ): ?> display-none <?php endif; ?>">
			    <label for="inputEmail3" class="col-sm-2 control-label input-sm"><?php echo Lang::get('misc.for_sale'); ?></label>
			    <div class="col-sm-10">
					<label class="checkbox-inline">
					 <input class="no-show" id="forSale" type="checkbox" <?php echo $checkIn; ?> value="<?php echo $valueForSale; ?>" name="for_sale" />
					   <span class="input-sm"><?php echo Lang::get('misc.yes'); ?> </span>
					</label>
			    </div>
			  </div><!-- **** form-group **** -->
			  
			  <div class="form-group forsale <?php if( $errors->first('url_purchased') ): ?> has-error <?php endif; ?>" <?php echo $styleInput; ?>>
			    <label for="inputEmail3" class="col-sm-2 control-label input-sm"><?php echo Lang::get('misc.url_purchased'); ?></label>
			    <div class="col-sm-10">
			      <input type="text" value="<?php echo $data->url_purchased; ?>" name="url_purchased" class="form-control input-sm forSaleInput" placeholder="<?php echo Lang::get('misc.url_purchased'); ?>">
			  
			   <?php if( $errors->first("url_purchased") ): ?>    	
			<div class="alert alert-danger btn-sm errors-account" role="alert">
	            	<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	            		<strong><?php echo $errors->first("url_purchased"); ?></strong>
	     	</div><!-- Error -->
	     	
	     	<?php endif; ?>
	     				    </div>
			  </div><!-- **** form-group **** -->
			  
			  
			  <div class="form-group forsale <?php if( $errors->first('price_item') ): ?> has-error <?php endif; ?>" <?php echo $styleInput; ?>>
			    <label for="inputEmail3" class="col-sm-2 control-label input-sm"><?php echo Lang::get('misc.price_item'); ?></label>
			    <div class="col-sm-10">
			      <input type="text" value="<?php echo $data->price_item; ?>" name="price_item" class="form-control input-sm forSaleInput" placeholder="<?php echo Lang::get('misc.price_item'); ?>">
			   
			   <?php if( $errors->first("price_item") ): ?>    	
			<div class="alert alert-danger btn-sm errors-account" role="alert">
	            	<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	            		<strong><?php echo $errors->first("price_item"); ?></strong>
	     	</div><!-- Error -->
	     	<?php endif; ?>
			   
			    </div>
			  </div><!-- **** form-group **** -->
			  
			  <div class="form-group <?php if( $errors->first('project') ): ?> has-error <?php endif; ?>  <?php if(Auth::user()->type_account == 1 ): ?> display-none <?php endif; ?>">
			    <label for="inputEmail3" class="col-sm-2 control-label input-sm"><?php echo Lang::get('misc.add_project'); ?></label>
			    <div class="col-sm-10">
			    	
			    	<select id="project" name="project" class="input-sm btn-block">
					  <option value="0">- <?php echo Lang::get('misc.none'); ?> -</option>
					  <?php foreach( $data->user()->projects as $project ){ ?>
					  	<option id="project<?php echo $project->id; ?>" value="<?php echo $project->id; ?>"><?php echo e( $project->title ); ?></option>
					  <?php } ?>
					</select>

			    </div>
			  </div><!-- **** form-group **** -->
			  
			  <div class="form-group <?php if( $errors->first('description') ): ?> has-error <?php endif; ?>">
			    <label class="col-sm-2 control-label input-sm"><?php echo Lang::get('misc.description'); ?> (<?php echo Lang::get('misc.optional'); ?>)</label>
			    <div class="col-sm-10">
			      <textarea name="description" rows="4" id="description" class="form-control input-sm textarea-textx"><?php echo e( $data->description ); ?></textarea>
	             
	             <?php if( $errors->first("description") ): ?>    	
			<div class="alert alert-danger btn-sm errors-account" role="alert">
	            	<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	            		<strong><?php echo $errors->first("description"); ?></strong>
	     	</div><!-- Error -->
	     	<?php endif; ?>
	     	
			    </div>
			  </div><!-- **** form-group **** -->
			  
			  <div class="alert alert-danger btn-sm display-none" id="errors_shot" role="alert"></div>
	
			  
			  <div class="form-group">
			    <div class="col-sm-offset-2 col-sm-10">
			      <button style="padding: 9px 30px;" disabled="disabled" data-send="<?php echo Lang::get('users.save'); ?>" data-wait="<?php echo Lang::get('misc.send_wait'); ?>" type="submit" class="btn btn-info btn-sm btn-sort" id="updateShot">
			      	<?php echo Lang::get('users.save'); ?>

			      	</button>
			    </div>
			  </div><!-- **** form-group **** -->
			  
			</form><!-- **** form **** -->
			    
	      </div><!-- modal-body -->
	      	     
	    
	    </div>
	  </div>
	</div> <!-- ***** Modal ****** -->
	 <?php endif; ?>
	 <?php /* End membershipTeam */ ?>
					
   <div class="btn-block text-right">
   	<?php if( Auth::user()->type_account == 3 && isset( $teamMembershipStatus ) 
   		|| Auth::user()->team_id != 0 && isset( $membershipTeam ) && Auth::user()->type_account == 1 
   		|| Auth::user()->type_account == 2 ): ?>
   	<a href="javascript:void(0);" class="btn btn-sm btn-success btn-padding" data-send="<?php echo Lang::get('users.save'); ?>" data-wait="<?php echo Lang::get('misc.send_wait'); ?>" data-id="<?php echo $data->id; ?>" data-toggle="modal" data-target="#myModal">
   		<i class="icon-pencil2 myicon-right myicon-right"></i> <?php echo Lang::get('users.edit'); ?>

   		</a>
   	<?php endif; ?>
   		
   	<a href="javascript:void(0);" data-id="<?php echo $data->id; ?>" class="btn btn-sm btn-danger delete-shot btn-padding">
   		<i class="glyphicon glyphicon-remove myicon-right"></i> <?php echo Lang::get('misc.delete'); ?>

   		</a>
   </div>
   <?php endif; ?>
   
   <h4 class="comments-title" id="commentsGrid">
   	<span class="fa fa-comment myicon-right color-strong"></span> 
   	<?php echo Lang::get('misc.comments'); ?> (<?php echo $comments_sql->getTotal(); ?>)
   	</h4>
   <hr />

<?php if( Auth::check() ): ?>   

<?php if( !$page || $comments_sql->getCurrentPage() == 1 ): ?>

<?php if( Auth::user()->type_account == 2 
	|| Auth::user()->type_account == 3 && isset( $teamMembershipStatus )
	|| Auth::user()->team_id != 0 && isset( $membershipTeam ) && Auth::user()->type_account == 1 
   	|| Auth::user()->type_account == 2
	): ?>
 <?php if( !$unblock ): ?>  
   <?php if($errors->first("comment")): ?>   	
			<div class="alert alert-danger btn-sm errors-account" role="alert">
	            	<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	            		<strong><?php echo $errors->first("comment"); ?></strong>
	     	</div><!-- Error -->
	     	<?php endif; ?>
	     	
	<div class="media">
            <span class="pull-left">
                <img alt="Image" src="<?php echo URL::asset('public/avatar'); ?>/<?php echo Auth::user()->avatar; ?>" class="media-object img-circle" width="50">
            </span>
            
            <div class="media-body">
            <form action="<?php echo URL::to('comment/send'); ?>" method="post">
            	<div class="form-group text-form <?php if( $errors->first('comment') ): ?> has-error <?php endif; ?>">
            		<input type="hidden" name="id_shot" value="<?php echo $data->id; ?>" />
            		<textarea name="comment" rows="4" id="comments" class="form-control input-sm textarea-comments mentions-textarea"></textarea>
            	</div>
                
                <div class="form-group ">
                	<button type="submit" class="btn btn-info btn-sm btn-sort" id="saveUpdate"><?php echo Lang::get('misc.post_comment'); ?></button>
                </div>
                </form>
            </div><!-- media body -->
 </div><!-- media -->
 <hr />
       <?php endif; ?> <?php /* Auth diferent author  */ ?>
    <?php endif; ?> <?php /* Page null */ ?>
    <?php endif; ?> <?php /* unblock */ ?>
 <?php endif; ?> <?php /* Auth True */ ?>
 
 <div class="col-thumb">
 
   <?php foreach($comments_sql as $comment): ?>
   <div class="media media-comments position-relative" id="comment<?php echo $comment->id; ?>">
    		<span class="pull-left">
    			<a href="<?php echo URL::to('@'); ?><?php echo $comment->user()->username; ?>">
    			<img width="50" height="50" class="media-object img-circle" src="<?php echo URL::asset('public/avatar').'/'.$comment->user()->avatar; ?>">
    		</a>
    		</span>
    		<div class="media-body media-body-comments">
    			<h4 class="media-heading col-thumb">
    				<a class="text-decoration-none" href="<?php echo URL::to('@'); ?><?php echo $comment->user()->username; ?>"><?php echo $comment->user()->name; ?></a>
    					</h4>
    			<p class="comments-p mentions-links">
    				<?php echo Helper::checkText( $comment->reply ); ?>

    			</p>
    			
    			
    			<div class="btn-block">
    				<small class="timeAgo small-comment" data="<?php echo date('c', strtotime( $comment->date )); ?>"></small> 
<?php if( Auth::check()  ): ?>	

<?php 
    
    $comment_like = CommentsLikes::where('user_id', '=', Auth::user()->id)->where('comment_id', '=', $comment->id)->where('status',1)->first(); 
    
	 if( isset( $comment_like ) ) {
	 	$textLike = Lang::get('misc.unlike');
		$activeLike = 'active-red';
	 } else {
	 	$textLike = Lang::get('misc.like');
		$activeLike = '';
	 }
    ?>
    
<?php if( $comment->user_id != Auth::user()->id ): ?>
    				- 
    
			<small class="small-comment">
				<a href="javascript:void(0);" data-id="<?php echo $comment->id; ?>" class="<?php echo $activeLike; ?> myicon-right text-decoration-none comment-like">
					<?php echo $textLike; ?>

					</a>
				</small>
    					
    				<?php else: ?> 
    				-
    				<small class="small-comment">
    					<a href="javascript:void(0);" data-id="<?php echo $comment->id; ?>" class="myicon-right text-decoration-none comment-delete"><?php echo Lang::get('misc.delete'); ?></a>
    					</small>
    					
    					<?php endif; ?>
    					
    				<?php endif; ?> <?php /*  Session active */ ?>
    				
    					<small class="pull-right like-small <?php if( $comment->total_likes() == 0 ): ?> display-none <?php endif; ?>">
    						<span class="<?php echo $activeLike; ?> fa fa-heart myicon-right"></span> 
    						<span class="count"><?php echo $comment->total_likes(); ?></span>
    						</small>
    			</div>
    		</div>
   </div><!-- media -->
   <?php endforeach; ?>
   
  </div><!-- media box -->
   
   <?php if( $comments_sql->getLastPage() > 1 && Input::get('page') <= $comments_sql->getLastPage() ): ?>
   <hr />
   <div class="btn-group paginator-style">
	        		<?php echo $comments_sql->links(); // $comments_sql->fragment('commentsGrid')->links() ?> 
	        	</div>
	        	<?php endif; ?>
	        	   
   <?php if( $comments_sql->count() == 0 ): ?>
   
    		<h3 class="margin-top-none text-center no-result row-margin-20">
	    	- <?php echo Lang::get('misc.no_comments_yet'); ?> -
	    	</h3>
	    	<?php endif; ?>
	 
	 
	 <?php if( Auth::guest() ): ?>
	 <hr />
	 	<div class="alert alert-warning text-center" role="alert">
	 		<?php echo Lang::get('auth.logged_in_comments'); ?> <a href="<?php echo URL::to('login'); ?>"><?php echo Lang::get('auth.sign_in'); ?></a>
	 	
	 	<?php if( $settings->registration_active == '1' ): ?>
	 		- <a href="<?php echo URL::to('join'); ?>"><?php echo Lang::get('auth.sign_up'); ?></a>
	 	<?php endif; ?>
	 		
	 	</div>
	 <?php endif; ?>
	 	
	
</div><!-- /col-md-8 -->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('sidebar'); ?>
<div class="col-md-4">
	  <button type="button" class="btn btn-default btn-block btn-border btn-lg show-toogle" data-toggle="collapse" data-target=".responsive-side" style="margin-bottom: 20px;">
		   <i class="fa fa-bars"></i>
		</button>
	
	<div class="responsive-side collapse">
		
		<!-- panel-default -->
	<div class="panel panel-default">
			<div class="panel-body padding-top padding-top-zero padding-right-zero padding-left-zero">
				    					
				<div style="background: url(<?php echo URL::asset('public/cover').'/'.$data->user()->cover; ?>) no-repeat center center #0088E2; background-size: cover;" class="cover-wall"></div>
				
			<div class="media media-visible pd-right">
				  <a href="<?php echo URL::to('@'); ?><?php echo $data->user()->username; ?>" class="btn-block photo-card-live myprofile">
				    <img class="border-image-profile img-circle photo-card" alt="Image" src="<?php echo URL::asset('public/avatar').'/'.$data->user()->avatar; ?>" width="80" height="80">
				  </a>
				  <div class="media-body">
				    <h4 class="user-name-profile-card btn-block  text-center">
				    	<a class="myprofile" href="<?php echo URL::to('@'); ?><?php echo $data->user()->username; ?>">
				    		<span class="none-overflow"><?php echo $data->user()->name; ?></span>
				    		</a>
					</h4>
					
					<?php if( Auth::check() ): ?>
    			 		
    			 		
    			 <?php if( $data->user()->id != Auth::user()->id ): ?>
    			    <?php if( !$unblock ): ?>
    			 		<div class="btn-block text-center col-thumb">
	    			 		<button type="button" class="btn btn-default btn-xs add-button btn-follow btnFollow myicon-right <?php echo $activeFollow; ?>" data-id="<?php echo $data->user()->id; ?>" data-follow="<?php echo Lang::get('users.follow'); ?>" data-following="<?php echo Lang::get('users.following'); ?>">
	    			 			<i class="glyphicon glyphicon<?php echo $icoFollow; ?> myicon-right"></i> <?php echo $textFollow; ?>

	    			 		</button>
    			 		</div>
    			 		<?php endif; ?>
    			 		<?php /* unblock  */ ?>
    			 		
    			 		<?php endif; ?>
    			 		<?php /* Avoid self follow  */ ?>
    			 		
    			 		<?php else: ?>
    			 	<div class="btn-block text-center col-thumb">	
    			 		<button type="button" class="btn btn-default btn-xs add-button btn-follow myicon-right shotTooltip" data-toggle="tooltip" data-placement="top" title="<?php echo Lang::get('misc.sign_in_or_sign_up'); ?>">
    			 			<i class="glyphicon glyphicon-plus myicon-right"></i> <?php echo Lang::get('users.follow'); ?>

    			 		</button>
    			 	</div>
    			 		<?php endif; ?>
				  </div>
				</div>
		
	    		<ul class="nav list-inline nav-pills btn-block nav-user-profile-wall">
	    			<li><a href="<?php echo URL::to('@'); ?><?php echo $data->user()->username; ?>"><?php echo Lang::get('misc.shots'); ?> <small class="btn-block sm-btn-size counter-sm"><?php echo Helper::formatNumber( User::totalShots( $data->user()->id ) ); ?></small></a></li>
	    			<li><a href="<?php echo URL::to('@'); ?><?php echo $data->user()->username; ?>/followers"><?php echo Lang::get('users.followers'); ?> <small class="btn-block sm-btn-size counter-sm"><?php echo Helper::formatNumber( User::totalFollowers( $data->user()->id ) ); ?></small></a></li>
	    			<li><a href="<?php echo URL::to('@'); ?><?php echo $data->user()->username; ?>/following"><?php echo Lang::get('users.following'); ?> <small class="btn-block sm-btn-size counter-sm"><?php echo Helper::formatNumber( User::totalFollowing( $data->user()->id ) ); ?></small></a></li>
	    			</ul>
	    		
			</div><!-- Panel Body -->
	</div><!-- panel-default -->

<?php if( isset( $next ) || isset( $previous ) ): ?>	
	<div class="li-title btn-block col-thumb">
		<?php echo Lang::get('misc.more_by'); ?>

		<a href="<?php echo URL::to('@'); ?><?php echo $data->user()->username; ?>"><strong><?php echo e( $data->user()->name ); ?></strong></a>
		</div>
	
	<div class="row" style="margin-bottom: 20px;">

<?php if( isset( $previous )): ?>

<?php
	
	if( Str::slug( $previous->title ) == '' ) {
	
		$slugUrl  = '';
	} else {
		$slugUrl  = '-'.Str::slug( $previous->title );
	}
	
	$slugUrlPrev = URL::to('/').'/shots/'.$previous->id.$slugUrl;
	 ?>
	<!-- Previous -->	
	<div class="col-xs-6 col-md-6">
    	<a class="image-thumb" id="prev" title="<?php echo e($previous->title); ?>" href="<?php echo $slugUrlPrev; ?>">
    			<img width="100%"class="media-object img-rounded img-thumbnail" src="<?php echo URL::asset('public/shots_img'); ?>/<?php echo $previous->image; ?>">
    			</a>
    </div><!-- col-xs-4 col-md-4 -->
    
    <?php else: ?>
    <div class="col-xs-6 col-md-6">
	    <a class="image-thumb">
	    	<img width="100%"class="media-object img-rounded img-thumbnail" src="<?php echo URL::asset('public/img'); ?>/start.jpg" alt="Image">
	    </a>
    </div><!-- col-xs-4 col-md-4 -->
    <?php endif; ?>
    
    
    <?php if( isset( $next )): ?>
    <?php
	
	if( Str::slug( $next->title ) == '' ) {
	
		$slugUrl  = '';
	} else {
		$slugUrl  = '-'.Str::slug( $next->title );
	}
	
	$slugUrlNext = URL::to('/').'/shots/'.$next->id.$slugUrl;
	 ?>
	<!-- Next -->	
	<div class="col-xs-6 col-md-6">
    	<a class="image-thumb" title="<?php echo e($next->title); ?>"  id="next" href="<?php echo $slugUrlNext; ?>">
    			<img width="100%"class="media-object img-rounded img-thumbnail" src="<?php echo URL::asset('public/shots_img'); ?>/<?php echo $next->image; ?>">
    			</a>
    </div><!-- col-xs-4 col-md-4 -->
    
    <?php else: ?>
    <div class="col-xs-6 col-md-6">
	    <a class="image-thumb">
	    	<img width="100%"class="media-object img-rounded img-thumbnail" src="<?php echo URL::asset('public/img'); ?>/end.jpg" alt="Image">
	    </a>
     </div><!-- col-xs-4 col-md-4 -->
    <?php endif; ?>
    
	</div><!-- row  -->
	
	<?php endif; ?>
	
	<?php if(Auth::check()): ?>
		<?php if( !$unblock ): ?>
		<span data-id="<?php echo $data->id; ?>" data-like="<?php echo Lang::get('misc.like'); ?>" data-like-active="<?php echo Lang::get('misc.unlike'); ?>" title="<?php if(!empty($likeUser)): ?> <?php echo Lang::get('misc.unlike'); ?> <?php else: ?> <?php echo Lang::get('misc.like'); ?> <?php endif; ?>" class="btn btn-lg btn-block btn-like-shots <?php if(!empty($likeUser)): ?> btn-success <?php else: ?> btn-danger <?php endif; ?> btn-like likeButton <?php if(!empty($likeUser)): ?> active <?php endif; ?>">
			<i class="glyphicon glyphicon-heart myicon-right"></i> <?php echo Lang::get('misc.like'); ?>

		</span>
		<?php endif; ?>
		<?php /* Unblock*/ ?>
		
		<?php else: ?>
			
		<a href="<?php echo URL::to('login'); ?>" class="btn btn-lg btn-block btn-like-shots btn-danger btn-like shotTooltip" data-toggle="tooltip" data-placement="top" title="<?php echo Lang::get('misc.sign_in_or_sign_up'); ?>">
			<i class="glyphicon glyphicon-heart myicon-right"></i> <?php echo Lang::get('misc.like'); ?>

		</a>
		<?php endif; ?>
			
		<ol class="details-shot">
			<li class="li-title"><strong><?php echo Lang::get('misc.details'); ?></strong></li>
			<li><span class="icon-clock myicon-right color-strong"></span> <?php echo Lang::get('misc.published'); ?> <span class="timeAgo pull-right color-strong" data="<?php echo date('c', strtotime( $data->date ) ); ?>"></span></li>
			<li><span class="fa fa-eye myicon-right color-strong"></span> <?php echo Lang::get('misc.views'); ?> <strong class="pull-right color-strong"><?php echo number_format( Shots::totalVisits( $data->id ) ); ?></strong></li>
			<li><span class="fa fa-heart myicon-right color-strong"></span> <?php echo Lang::get('misc.likes'); ?> <strong class="pull-right color-strong" id="countLikes"><?php echo number_format( Shots::totalLikes( $data->id ) ); ?></strong></li>
			<li><span class="fa fa-comment myicon-right color-strong"></span> <?php echo Lang::get('misc.comments'); ?> <strong class="pull-right color-strong"><?php echo number_format( Shots::totalComments( $data->id  ) ); ?></strong></li>
		   
		   <?php if( $data->url_purchased != '' ): ?>
		   		<?php 
		   		$url =  parse_url($data->url_purchased);
				$host = $url['host'];
		   		?>
		   	<li><span class="icon-cart myicon-right color-strong"></span> <a href="<?php echo e($data->url_purchased); ?>" target="_blank"><?php echo Lang::get('misc.buy_at'); ?> <?php echo e(Str::title($host)); ?> $<?php echo $data->price_item; ?></a>  </li>
		   <?php endif; ?>
		   
		   <?php if( isset( $data->project->id ) ): ?> 
		   <?php
			$urlProject = URL::to('/').'/@'.$data->user()->username.'/projects/'.$data->project->id.'-'.$data->project->slug;
	 		?>
		    <li><span class="icon-folder-open myicon-right color-strong"></span> <?php echo Lang::get('misc.in'); ?> <a href="<?php echo $urlProject; ?>"><?php echo $data->project->title; ?></a> </li>
		    <?php endif; ?>
		    
		    <li class="li-title"><strong><?php echo Lang::get('misc.color_palette'); ?></strong></li>
		    <div class="colorContainer btn-block pull-left col-thumb"></div>
		
		    
		    <?php 
	           $tags = explode(',', $data->tags); 
	           $count_tags = count( $tags );
	           ?>
			<li class="li-title"><strong><?php echo Str::upper( Lang::get('misc.tags') ); ?></strong></li>
			<li>
				<?php for( $i = 0; $i < $count_tags; ++$i ): ?>
				<a href="<?php echo URL::to('search?q='); ?><?php echo Helper::spacesUrl( $tags[$i]); ?>" class="btn btn-danger tags font-default btn-xs">
					<?php echo $tags[$i]; ?>

				</a>
				<?php endfor; ?>
			</li>
		</ol>
		
	<hr class="margin-top-zero" />
		
		
		<?php echo $__env->make('includes.ads', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
	</div><!-- responsive collapse --> 
</div><!-- /End col md-4 -->

<?php $__env->stopSection(); ?>

<?php $__env->startSection('javascript'); ?>

  <?php echo HTML::script('public/js/jquery.form.js'); ?>

  <?php echo HTML::script('public/js/colorthief.js'); ?>

  
  <?php if( Auth::check() && !$page && Auth::user()->type_account != 1 || Auth::check() && $comments_sql->getCurrentPage() == 1 && Auth::user()->type_account != 1 ): ?>
  	<?php echo HTML::script('public/js/mentions.js'); ?>

  	
  	<?php endif; ?>
  
  <?php if( Auth::check() && Auth::user()->id == $data->user()->id ): ?>	
    <?php echo HTML::script('public/js/bootstrap-tokenfield.js'); ?>

  <?php endif; ?>
  
<script type="text/javascript">

<?php if( Auth::check() ): ?>

  $('#project<?php echo $data->id_project; ?>').attr({'selected':'selected'});
  
  <?php if(Session::has('success_update')): ?>
	 $('.popout').html("<?php echo Session::get('success_update'); ?>").fadeIn(500).delay(5000).fadeOut();
   <?php endif; ?>
   
   <?php if( Session::has('error_update') ): ?>
   	$('#myModal').modal('show');
   <?php endif; ?>
   
  <?php if( Auth::user()->id == $data->user()->id || Auth::user()->role == 'admin' ): ?>
  
  //<<<---------- Delete Account      
  $(".delete-shot").click(function() {
   	
   	element = $(this);
   	var id  = element.attr("data-id");
   	var info= 'shot_id=' + id;
   	
   	bootbox.confirm("<?php echo Lang::get('misc.delete_shot'); ?>", function(r) {
   		if( r == true ) {
   			
   		$.ajax({
		   type: "POST",
		   url: "<?php echo URL::to('/'); ?>/delete/shot",
		   dataType: 'json',
		   data: info,
		   success: function( data ) {
		   	
				if(data.success == true ){
					var location = "<?php echo URL::to('/'); ?>";
   					window.location.href = location;
				} else {
					bootbox.alert(data.error);
					window.location.reload();
				}

				}//<-- RESULT 
			});
	
	 		}//END IF R TRUE 
	  }); //Jconfirm  
   });
   
   <?php endif; ?>

<?php if( Auth::user()->id == $data->user()->id ): ?>   

  	$('#tags').on('tokenfield:createdtoken', function (e) {
	    var re = /^[a-z0-9][\w\s\ÀÈÌÒÙàèìòùÁÉÍÓÚÝáéíóúýÂÊÎÔÛâêîôûÃÑÕãñõÄËÏÖÜäëïöüçÇßØøÅåÆæÞþÐð\-]+$/i
	    var valid = re.test(e.attrs.value)
	    if (!valid) {
	      $(e.relatedTarget).addClass('invalid').remove()
	    }
	  }).tokenfield({
		limit: 10,
		beautify: false
		});

    
		//** Changes Form **//
function changesForm () {
var button = $('#updateShot');
$('form.edit-shot input, select, textarea, checked').each(function () {
    $(this).data('val', $(this).val());
    $(this).data('checked', $(this).is(':checked'));
});

$('form.edit-shot  input, select, textarea, checked').bind('keyup change blur', function(){
    var changed  = false;
    var ifChange = false;
    button.css({'opacity':'0.7','cursor':'default'});
    
    $('form.edit-shot  input, select, textarea, checked').each(function () {
        if( trim( $(this).val() ) != $(this).data('val') || $(this).is(':checked') != $(this).data('checked') ){
            changed = true;
            ifChange = true;
            button.css({'opacity':'1','cursor':'pointer'})
        }
       
    });
    button.prop('disabled', !changed);
});
}//<<<--- Function
changesForm();

  <?php endif; ?>

// Comments Delete
$('.comment-delete').click(function(){
			element = $(this);
			element.removeClass('comment-delete');
			$.post("<?php echo URL::to('/'); ?>/comment/delete", { comment_id: $(this).data('id') }, function(data){
				if(data.success == true ){
					url = '<?php echo URL::to("/")."/".Request::path(); ?>';
					window.location.reload();
				} else {
					bootbox.alert(data.error);
					window.location.reload();
				}
				
				if( data.session_null ) {
					window.location.reload();
				}
			},'json');
		});
		
		// Likes Comments
		$('.comment-like').click(function(){
			element  = $(this);
			
			element.html('<i class="fa fa-spinner fa-spin"></i>');
			
			$.post("<?php echo URL::to('/'); ?>/comment/like", { comment_id: $(this).data('id') }, function(data){
				if(data.success == true ){
					if( data.type == 'like' ) {
						element.html('<?php echo Lang::get("misc.unlike"); ?>').addClass('active-red')
						element.parents('.btn-block').find('.count').html(data.count).fadeIn();
						element.parents('.btn-block').find('.like-small').fadeIn();
						element.parents('.btn-block').find('.fa').addClass('active-red');
						element.blur();
						
					} else if( data.type == 'unlike' ) {
						element.html('<?php echo Lang::get("misc.like"); ?>').removeClass('active-red');
					
					if( data.count == 0 ) {
						element.parents('.btn-block').find('.count').html(data.count).fadeOut();
						element.parents('.btn-block').find('.like-small').fadeOut();
					} else {
						element.parents('.btn-block').find('.count').html(data.count).fadeIn();
						element.parents('.btn-block').find('.like-small').fadeIn();
					}	
						
						
						element.parents('.btn-block').find('.fa').removeClass('active-red');
						element.blur();
					}
				} else {
					bootbox.alert(data.error);
					window.location.reload();
				}
				
				if( data.session_null ) {
					window.location.reload();
				}
			},'json');
		});
		
		
// Report Shot
$('.report-shot').click(function(){
			element = $(this);
			element.removeClass('comment-delete');
			$.post("<?php echo URL::to('/'); ?>/report/shot", { shot_id: $(this).data('id') }, function(data){
				if(data.success == true ){
					element.remove();
					$('.popout').html("<?php echo Lang::get('misc.reported_success'); ?>").fadeIn(500).delay(5000).fadeOut();
				} else {
					bootbox.alert(data.error);
					window.location.reload();
				}
				
				if( data.session_null ) {
					window.location.reload();
				}
			},'json');
		});
<?php endif; ?>

	<?php if( $page ): ?>
	
		scrollElement('#commentsGrid');
	
	<?php endif; ?>

$(document).ready(function(){
$('body').keyup(function (event) {
    var next        = $('#next').attr('href');
    var prev        = $('#prev').attr('href');
    
         if ( event.target.tagName.toLowerCase() !== 'input' 
		        && event.target.tagName.toLowerCase() !== 'textarea' 
		        && event.keyCode == 37 && prev != undefined) {
            // Anterior
            location.href=prev;
            
        } else if ( event.target.tagName.toLowerCase() !== 'input' 
		        && event.target.tagName.toLowerCase() !== 'textarea' 
		        && event.keyCode == 39 && next != undefined) {
            // Siguiente
            location.href=next;
        }
        
        <?php if( Auth::check() ): ?>
        if ( event.target.tagName.toLowerCase() !== 'input' 
		        && event.target.tagName.toLowerCase() !== 'textarea' 
		        && event.keyCode == 76 ) {
            $(".likeButton").trigger('click');
        }
        <?php endif; ?>
        
    });// keyup
    
    $('.comments-p').readmore({
		maxHeight: 120,
		moreLink: '<a href="javascript:void(0);">'+ReadMore+'</a>',
		lessLink: '<a href="javascript:void(0);">'+ReadLess+'</a>',
		sectionCSS: 'display: block; width: 100%;',
	});
});//document
		
$("#comments").charCount({ allowed: <?php echo $settings->comment_length; ?>, warning: 10, css: 'counterBio' });

$('input,select').not('#btnItems').keypress(function(event) { return event.keyCode != 13; });
  
$("#description").charCount({ allowed: <?php echo $settings->shot_length_description; ?>, warning: 10, css: 'counterBio' });


</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>